package leecode

type MyQueueM struct {
	stack []int
}

/** Initialize your data structure here. */
func ConstructorM0304() MyQueueM {
	return MyQueueM{stack: make([]int, 0)}
}

/** Push element x to the back of queue. */
func (this *MyQueueM) Push(x int) {
	this.stack = append(this.stack, x)
}

/** Removes the element from in front of queue and returns that element. */
func (this *MyQueueM) Pop() int {
	result := this.stack[0]
	this.stack = this.stack[1:]
	return result
}

/** Get the front element. */
func (this *MyQueueM) Peek() int {
	return this.stack[0]
}

/** Returns whether the queue is empty. */
func (this *MyQueueM) Empty() bool {
	return len(this.stack) == 0
}
